﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Interfaces.Web.Twitter
{
    /// <summary>
    /// This class represents a stats item of a twitter account.
    /// </summary>
    [Serializable]
    public class Status : IStatus
    {
        /// <summary>
        /// The id information.
        /// </summary>
        private string id;

        /// <summary>
        /// The createdAt information.
        /// </summary>
        private string createdAt;

        /// <summary>
        /// The text information.
        /// </summary>
        private string text;

        /// <summary>
        /// Initializes a new instance of the <see cref="Status"/> class.
        /// </summary>
        public Status()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Status"/> class.
        /// </summary>
        /// <param name="id">The id information.</param>
        /// <param name="createdAt">The createdAt information.</param>
        /// <param name="text">The text information.</param>
        public Status(string id, string createdAt, string text)
        {
            this.id = id;
            this.createdAt = createdAt;
            this.text = text;
        }

        /// <summary>
        /// Gets or sets the id information.
        /// </summary>
        /// <value>The id information.</value>
        public string Id
        {
            get { return id; }
            set { id = value; }
        }

        /// <summary>
        /// Gets or sets the CreatedAt information.
        /// </summary>
        /// <value>The CreatedAt information.</value>
        public string CreatedAt
        {
            get { return createdAt; }
            set { createdAt = value; }
        }

        /// <summary>
        /// Gets or sets the text information.
        /// </summary>
        /// <value>The text information.</value>
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        /// <summary>
        /// Compares the current status instance to another one.
        /// </summary>
        /// <param name="compare">The instance to compare.</param>
        /// <returns>True if the values of the current instance and the specified instance are equal otherwise, false.</returns>
        public bool CompareTo(Status compare)
        {
            return (this.id == compare.Id) && (this.createdAt == compare.CreatedAt) && (this.text == compare.Text);
        }

        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public override string ToString()
        {
            String result = "";

            result += "id=" + this.id + ";";
            result += "createdAt=" + this.createdAt + ";";
            result += "text=" + this.text + ";";

            return result;
        }
    }
}